﻿@model SpaceNeedle.City6473.WebSite.Models.UsersModel
@using SpaceNeedle.City6473.Web.Data.Models


@{
    Layout = "~/Views/Shared/_Layout.cshtml";

    var staticContent = ViewBag.StaticContent as WebSiteContent;
    ViewBag.Title = staticContent.Users.PageTitle;
}

<a href="/Admin/CreateUser" title="@staticContent.Operations.Add">@Html.Raw(staticContent.Users.New)</a>
<br /><br />
<table style="width:960px;">
    <tr>
        <th style="text-align:left">
            @staticContent.Users.Name
        </th>
        <th style="text-align:left">
            @staticContent.Users.Email
        </th>
        <th style="text-align:left">
            @staticContent.Users.Roles
        </th>
        <th style="text-align:left">
            @staticContent.Users.IsActive
        </th>
        <th>

        </th>
    </tr>

    @foreach (var item in Model.Users)
    {
        <tr>
            <td>
                @item.Name
            </td>
            <td>
                @item.Email
            </td>
            <td>
                @Model.GetRoleName(item.Roles)
            </td>
            <td>
                @(item.IsActive ? "Sim" : "Não")
            </td>
            <td>
                <a href="/admin/deleteuser/@item.Id" onclick="return confirm('@string.Format(staticContent.Operations.DeleteMessage, item.Name)?')" title="@staticContent.Operations.Delete" style="font-family:'Segoe UI Symbol';font-size:18px;">@Html.Raw(staticContent.Operations.DeleteSymbol)</a>
            </td>
            <td>
                <a href="/Admin/EditUser/@item.Id" style="font-family:'Segoe UI Symbol';font-size:18px;" title="@staticContent.Operations.Edit">@Html.Raw(staticContent.Operations.EditSymbol)</a>
            </td>
        </tr>
    }

</table>




